# 最低要求的 CMake 版本
cmake_minimum_required(VERSION 3.15)

# 项目名称
project(plan)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif()

option(PC "PC Debug" OFF)

message("CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message("PC Mode: ${PC}")

file(GLOB_RECURSE SRCS "src/*.cpp")

include_directories(${CMAKE_SOURCE_DIR}
                    ${CMAKE_SOURCE_DIR}/src
                    )

add_library(planer STATIC ${SRCS})

if(PC)
    find_package(OpenCV REQUIRED)
    message("OpenCV_INCLUDE_DIRS: ${OpenCV_INCLUDE_DIRS}")
    
    include_directories(${OpenCV_INCLUDE_DIRS})
    add_executable(test main.cpp)
    target_link_libraries(test planer ${OpenCV_LIBS})
endif()